let config = {
  qiNiuDomain: '', //七牛域名 做图片压缩识别
  mapKey: '', //腾讯地图key,逆解析使用
  geocoder: true, //经纬度是否需要逆解析

  // #ifdef H5
  // baseUrl: 'http://124.156.120.66:11150/api', //基础URL 正式环境
  // upLoadUrl: 'http://124.156.120.66:11150/api/common/upload', //上传接口地址
  baseUrl: 'http://112.213.108.182:11150/api', //基础URL 正式环境
  upLoadUrl: 'http://112.213.108.182:11150/api/common/upload', //上传接口地址
  // #endif

  // #ifdef APP-PLUS
  // baseUrl: 'http://124.156.120.66:11150/api', //基础URL 正式环境
  // upLoadUrl: 'http://124.156.120.66:11150/api/common/upload', //上传接口地址
  baseUrl: 'http://112.213.108.182:11150/api', //基础URL 正式环境
  upLoadUrl: 'http://112.213.108.182:11150/api/common/upload', //上传接口地址
  // #endif

  loginCode: 401, //后端登录约定token过期code
  tokenName: 'token', //token名称
  loginSetting: {
    //登录设置
    loginModal: false, //是否开启弹窗登录
    loginPath: '/pages/login/index', //登录跳转页面，未开启登录弹窗起效
    needPhone: false, //登录是否需要手机号码
  },
};

let base = uni.getStorageSync('baseUrl');
if (base) {
  config.baseUrl = base + '/api';
  config.upLoadUrl = base + '/api/common/upload';
}

uni.$on('changeBaseUrl', (url) => {
  console.log(url);
  config.baseUrl = url + '/api';
  config.upLoadUrl = url + '/api/common/upload';
  uni.setStorageSync('baseUrl', url);
});

export default config;
